home *** CD-ROM | disk | FTP | other *** search
- class classes.shots.BomberALaser
- {
- var id;
- var x;
- var y;
- var dir;
- var l;
- var xInc;
- var clip;
- var power = 40;
- var c = 1;
- var endMessageSent = false;
- var Name = "bomberALaser";
- function BomberALaser(px, py, pdir, pl, pid)
- {
- this.id = pid;
- this.x = px;
- this.y = py;
- this.dir = pdir;
- this.l = pl;
- this.xInc = this.dir != "L" ? 25 : -25;
- _root.d = _root.d + 1;
- this.clip = _root.createEmptyMovieClip("bomberALaser" + this.id + "Clip",_root.d);
- this.clip._x = this.x;
- this.clip._y = this.y;
- _root.d = _root.d + 1;
- this.clip.attachMovie("bomberALaserSeg","bomberALaserSeg1Clip" + this.id,_root.d);
- }
- function main()
- {
- this.c = this.c + 1;
- if(this.x + (this.c - 1) * this.xInc < 1050 && this.x + (this.c - 1) * this.xInc > -50)
- {
- _root.d = _root.d + 1;
- var _loc3_ = this.clip.attachMovie("bomberALaserSeg","bomberALaserSeg" + this.c + "Clip" + this.id,_root.d);
- _loc3_._x = (this.c - 1) * this.xInc;
- _loc3_.gotoAndStop(this.c);
- }
- else if(this.c < this.l)
- {
- this.l = this.c;
- }
- if(this.c > this.l)
- {
- if(!this.endMessageSent)
- {
- _root["bomberA" + this.id].stopLaserFire();
- this.endMessageSent = true;
- }
- removeMovieClip(this.clip["bomberALaserSeg" + (this.c - this.l) + "Clip" + this.id]);
- }
- if(_root["bomberA" + this.id].laser.firing)
- {
- this.clip._x = this.dir != "L" ? _root["bomberA" + this.id].x + 18 : _root["bomberA" + this.id].x - 25;
- this.clip._y = _root["bomberA" + this.id].y - 3;
- }
- if(this.clip.hitTest(_root[_root.char + "Clip"]))
- {
- _root[_root.char].hit(this.xInc,0,100,this.power);
- }
- if(this.clip._width < 25)
- {
- _root.removeEnemyShot("bomberALaser" + this.id);
- }
- }
- }
-